package data;

/**
 * 子弹数据类
 */
public class BulletData {
    // -------------------- 数据设计 --------------------
    private int x, y;                   // 坐标
    private int width = 8, height = 8;  // 尺寸
    private int direction;              // 方向
    private int speed = 8;              // 速度
    private int state = 0;              // 状态 0空闲1飞行
    private TankData tank;              // 所属坦克
    private int atk;                    // 攻击力
    // -------------------- 数据设计 --------------------

    public BulletData(TankData tank) {
        this.tank = tank;
        this.atk = (int)(Math.random() * 20) + 20; // 20-40攻击力
        this.x = -100;
        this.y = -100;
    }

    // getter和setter方法
    public int getX() { return x; }
    public void setX(int x) { this.x = x; }
    public int getY() { return y; }
    public void setY(int y) { this.y = y; }
    public int getWidth() { return width; }
    public int getHeight() { return height; }
    public int getDirection() { return direction; }
    public void setDirection(int direction) { this.direction = direction; }
    public int getSpeed() { return speed; }
    public int getState() { return state; }
    public void setState(int state) { this.state = state; }
    public int getAtk() { return atk; }
    public TankData getTank() { return tank; }
}